<?php
/* @var $this ProductsController */
/* @var $model Products */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'products-form',
	// Please note: When you enable ajax validation, make sure the corresponding
	// controller action is handling ajax validation correctly.
	// There is a call to performAjaxValidation() commented in generated controller code.
	// See class documentation of CActiveForm for details on this.
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'nomeProdotto'); ?>
		<?php echo $form->textField($model,'nomeProdotto',array('size'=>50,'maxlength'=>50)); ?>
		<?php echo $form->error($model,'nomeProdotto'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'quantita'); ?>
		<!--<?php echo $form->textField($model,'quantita'); ?>-->
                <?php echo CHtml::activeNumberField($model, 'quantita'); ?>
		<?php echo $form->error($model,'quantita'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'descrizione'); ?>
		<?php echo $form->textArea($model,'descrizione',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'descrizione'); ?>
	</div>

	<div class="row">
                <?php 
                    //$data=array(1,2,3,4,5,6,7,8,9,10,11,12);
                    $operator = Category::model()->findAll();
                ?>
		<?php echo $form->labelEx($model,'category_id'); ?>
		<?php echo $form->listBox($model, 'category_id', CHtml::listData($operator, 'id', 'category'), array('size'=>1)); ?>
		<?php echo $form->error($model,'category_id'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? Yii::t('app', 'Insert') : Yii::t('app', 'Save')); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->